package com.zym.controller;

import com.zym.Valid.AddGroup;
import com.zym.Valid.UpdateGroup;
import com.zym.annon.Log;
import com.zym.entity.Users;

import com.zym.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@Validated
@Api(tags = "测试接口")
@RestController
@RequestMapping("/test")
public class TestController {
    @ApiOperation("测试1")
    @GetMapping("/test1")
    public R test1(){
        System.out.println("test1方法体执行了");
        return R.ok();
    }
    @Log(title = "test2")
    @ApiOperation("测试2")
    @PostMapping("/test2")
    public R test2(@Validated({AddGroup.class}) @RequestBody Users users){
        System.out.println("test2方法体执行了");
        return R.ok();
    }
    @Log(title = "test3")
    @ApiOperation("测试3")
    @PostMapping("/test3")
    public R test3(@Validated({UpdateGroup.class}) @RequestBody Users users){
        System.out.println("test3方法体执行了");
        return R.ok();
    }
}
